/**
 *  路由文件
 *  引入[Vue, VueRouter]模块
 */
import Vue from 'vue'
import VueRouter from 'vue-router'

/**
 *  加载模块
 */
Vue.use(VueRouter)

/**
 *  配置路由
 */
const router = new VueRouter({
    routes: [{ //初始化系统
            path: '/init',
            name: 'init',
            title: '初始化系统',
            meta: {
                requireAuth: false,
            },
            component: function(resolve) {
                require(['./components/init.vue'], resolve)
            }
        },
        { //登录页面
            path: '/login',
            name: 'login',
            title: 'vue login',
            meta: {
                requireAuth: false,
            },
            component: function(resolve) {
                require(['./components/login.vue'], resolve)
            }
        },
        { //主页面
            path: '/home',
            name: 'home',
            title: 'home',
            component: function(resolve) {
                require(['./components/home.vue'], resolve)
            }
        },
        { //登录页面
            path: '/*',
            name: 'home',
            title: 'vue home',
            meta: {
                requireAuth: true,
            },
            component: function(resolve) {
                require(['./components/login.vue'], resolve)
            }
        },

    ]
})
export default router
